<div id="background">
  <form class="layui-form" *ngIf="roomType">
    <div class="layui-form-item">
      <div class="layui-form-inline">
        <label class="layui-form-label">名称</label>
        <div class="layui-input-inline">
          <input type="text" name="name" required lay-verify="required" placeholder="请输入房间类型名称" autocomplete="off" class="layui-input"
            [(ngModel)]="roomType.name">
        </div>
      </div>

      <div class="layui-form-inline">
        <label class="layui-form-label">长度</label>
        <div class="layui-input-inline">
          <input type="text" name="langth" required lay-verify="required" placeholder="请输入房间长度" autocomplete="off" class="layui-input"
            [(ngModel)]="roomType.langth">
        </div>
      </div>
    </div>

    <div class="layui-form-item">
      <div class="layui-form-inline">
        <label class="layui-form-label">宽度</label>
        <div class="layui-input-inline">
          <input type="text" name="width" required lay-verify="required" placeholder="请输入房间宽度" autocomplete="off" class="layui-input"
            [(ngModel)]="roomType.width">
        </div>
      </div>
      <div class="layui-form-inline">
        <label class="layui-form-label">窗户数量</label>
        <div class="layui-input-inline">
          <input type="text" name="numWin" required lay-verify="required" placeholder="请输入窗户数量" autocomplete="off" class="layui-input"
            [(ngModel)]="roomType.numWin">
        </div>
      </div>
    </div>
    <div class="layui-form-item">
      <div class="layui-form-inline">
        <label class="layui-form-label">双人床数量</label>
        <div class="layui-input-inline">
          <input type="text" name="numDouble" required lay-verify="required" placeholder="请输入双人床数量" autocomplete="off" class="layui-input"
            [(ngModel)]="roomType.numDoubleBed">
        </div>
      </div>
      <div class="layui-form-inline">
        <label class="layui-form-label">单人床数量</label>
        <div class="layui-input-inline">
          <input type="text" name="numSingle" required lay-verify="required" placeholder="请输入单人床数量" autocomplete="off" class="layui-input"
            [(ngModel)]="roomType.numSingleBed">
        </div>
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">价格</label>
      <div class="layui-input-inline">
        <input type="text" name="price" required lay-verify="required" placeholder="请输入价格" autocomplete="off" class="layui-input"
          [(ngModel)]="roomType.price">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">电视</label>
      <div class="layui-input-inline">
        <input type="text" name="haveTV" required lay-verify="required" placeholder="有/无" autocomplete="off" class="layui-input"
          [(ngModel)]="roomType.haveTV">
      </div>
    </div>

    <div class="layui-form-item">
      <label class="layui-form-label">冰箱</label>
      <div class="layui-input-inline">
        <input type="text" name="haveRef" required lay-verify="required" placeholder="有/无" autocomplete="off" class="layui-input"
          [(ngModel)]="roomType.haveRef">
      </div>
    </div>

    <div class="layui-form-item">
      <label class="layui-form-label">空调</label>
      <div class="layui-input-inline">
        <input type="text" name="haveAirc" required lay-verify="required" placeholder="有/无" autocomplete="off" class="layui-input"
          [(ngModel)]="roomType.haveAirc">
      </div>
    </div>



    <div class="layui-form-item">
      <div class="layui-input-block">
        <button class="layui-btn" lay-submit lay-filter="formDemo" (click)="updateRoomType()">立即提交</button>
        <button type="reset" class="layui-btn layui-btn-primary" (click) = "reset()">重置</button>
      </div>
    </div>
  </form>
</div>
